/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package JC.utileria;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.media.ControllerEvent;
import javax.media.Player;
import javax.swing.Timer;

/**
 *
 * @author cabarcas
 */
public class Tiempo {

    private Timer timer;
    private Player player;
    private int seg,min;
    public Tiempo( Reproductor r){
        final Reproductor reproductor=r;
        this.player=r.getPlayer();
        
        timer=new Timer(1000, new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                reproductor.controllerUpdate(new ControllerEvent(player));
            }
        });
    }

    /**
     * @return the timer
     */
    public Timer getTimer() {
        return timer;
    }

    /**
     * @param timer the timer to set
     */
    public void setTimer(Timer timer) {
        this.timer = timer;
    }

    /**
     * @return the player
     */
    public Player getPlayer() {
        return player;
    }

    /**
     * @param player the player to set
     */
    public void setPlayer(Player player) {
        this.player = player;
    }

}
